package com.zimin.cloud.system.controller;

import com.zimin.cloud.mine.pojo.system.business.MenuBO;
import com.zimin.cloud.system.biz.IMenuBiz;
import com.zimin.cloud.system.controller.api.IMenuController;
import com.zimin.shared.annotation.OpLog;
import com.zimin.shared.enums.ModuleEnum;
import com.zimin.shared.pojo.BaseController;
import com.zimin.shared.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜单权限 前端控制器
 * </p>
 *
 * @author zimin
 * @since 2021-12-30 11:05
 */
@RestController
public class MenuController extends BaseController implements IMenuController {

    @Autowired
    private IMenuBiz menuBiz;

    @Override
    public Result routes(MenuBO menuBO) {
        return result(menuBiz.routes(menuBO));
    }

    @Override
    public Result allRoutes(MenuBO menuBO) {
        return result(menuBiz.allRoutes(menuBO));
    }

    @Override
    public Result save(MenuBO menuBO) {
        return result(menuBiz.save(menuBO));
    }

    @Override
    public Result update(MenuBO menuBO) {
        return result(menuBiz.updateById(menuBO));
    }

    @Override
    public Result delete(List<String> idList) {
        return result(menuBiz.removeByIds(idList));
    }
}
